import Vue from 'vue';
import Vuex from 'vuex';
import createPersistedState from 'vuex-persistedstate';
Vue.use(Vuex);

import user from './user';
import lover from './lover';

const PERSIST_PATHS = ['lover', 'user.token', 'user.userList']; // 需要持久化的数据

export default new Vuex.Store({
  modules: {
    user,
    lover,
  },

  plugins: [createPersistedState({ key: 'self', paths: PERSIST_PATHS })],
});
